package com.dragon.design.pattern.creational.prototype;

/**
 * @author dragon
 * @version V1.0.0-RELEASE
 * @date 2019/5/17 19:21
 */
public class C implements Cloneable {

    private String name;

    private E e;

    public E getE() {
        return e;
    }

    public void setE(E e) {
        this.e = e;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public C getCloneInstance() throws CloneNotSupportedException {
        return (C) super.clone();
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        C c = (C) super.clone();
        E e = (E) c.getE().clone();
        c.setE(e);
        return c;
    }
}
